home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / AppsToGo / Kibitz / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.3 KB  |  104 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:             start.c
  5. ** Originally from:  Traffic Light 2.0 (2.0 version by Keith Rollin)
  6. ** Modified by:      Eric Soldan
  7. **
  8. ** Copyright © 1989-1992 Apple Computer, Inc.
  9. ** All rights reserved. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #include "Kibitz.h"                /* Get the Kibitz includes/typedefs, etc.    */
  18. #include "KibitzCommon.h"        /* Get the stuff in common with rez.        */
  19. #include "Kibitz.protos"        /* Get the prototypes for Kibitz.            */
  20.  
  21. #ifndef __TOOLUTILS__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25. #ifndef __TEXTEDITCONTROL__
  26. #include <TextEditControl.h>
  27. #endif
  28.  
  29. #ifndef    __TSMTE__
  30. #include <TSMTE.h>
  31. #endif
  32.  
  33.  
  34.  
  35. /*****************************************************************************/
  36.  
  37.  
  38.  
  39. extern void _DataInit();
  40.  
  41.  
  42.  
  43. /*****************************************************************************/
  44. /*****************************************************************************/
  45.  
  46. #ifdef applec
  47. #pragma segment appStart
  48. #endif
  49.  
  50. /*****************************************************************************/
  51. /*****************************************************************************/
  52.  
  53.  
  54.  
  55. void    main(void)
  56. {
  57.     NamesTableEntry    appNTE;
  58.     EntityName        appEntityName;
  59.     OSErr            atErr;
  60.  
  61. #ifdef __PPCC__
  62.     /* 
  63.        Work around compiler bug with aggregate initializers
  64.        of mixed alignment structures.
  65.     */
  66.     extern void InitNewDocData(void);
  67.     InitNewDocData();
  68. #endif /* __PPCC__ */
  69.  
  70. #ifdef applec
  71.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  72. #endif
  73.     
  74.     SetApplLimit(GetApplLimit() - 16384);
  75.         /* This decreases the application heap by 16k, which in turn
  76.         ** increases the stack by 16k. */
  77.  
  78.     MaxApplZone();        /* Expand the heap so code segments load at the top. */
  79.     Initialize();                            /* Initialize the program. */
  80.  
  81.     DoSetCursor(*GetCursor(watchCursor));    /* Rest of startup may take a while. */
  82.  
  83.     StartDocuments();                /* Open (or print) designated documents. */
  84.  
  85.     if(CTEUseTSMTE())
  86.         InitTSMAwareApplication();
  87.  
  88.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  89.  
  90.     atErr = AddPPCNBPAlias(&appNTE, "\pKibitz", &appEntityName);
  91.  
  92.     EventLoop();                /* Call the main event loop. */
  93.  
  94.     if (!atErr) RemoveNBPAlias(&appEntityName);
  95.  
  96.     if(CTEUseTSMTE())
  97.         CloseTSMAwareApplication();
  98.  
  99.     ExitToShell();                    /* Quit the application. */
  100. }
  101.  
  102.  
  103.  
  104.